package com.ruoyi.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.cinema.domain.Customer;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.order.domain.MemberCardOrder;
import com.ruoyi.order.domain.Order;
import com.ruoyi.order.domain.OrderRefund;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 订单Service接口
 *
 * @author HHAOYU
 * @date 2020-12-14
 */
public interface IOrderService  extends IService<Order> {

    /**
     * 查询订单
     *
     * @param id 订单ID
     * @return 订单
     */
    public Order selectOrderById(Long id);

    /**
     * 查询订单列表
     *
     * @param order 订单
     * @return 订单集合
     */
    public List<Order> selectOrderList(Order order);

    /**
     * 新增订单
     *
     * @param order 订单
     * @return 结果
     */
    public int insertOrder(Order order);

    /**
     * 修改订单
     *
     * @param order 订单
     * @return 结果
     */
    public int updateOrder(Order order);

    /**
     * 批量删除订单
     *
     * @param ids 需要删除的订单ID
     * @return 结果
     */
    public int deleteOrderByIds(Long[] ids);

    /**
     * 删除订单信息
     *
     * @param id 订单ID
     * @return 结果
     */
    public int deleteOrderById(Long id);

    public AjaxResult wechatPrePay(Long orderId, Long totalMoney, String openId, String outOrderNo, HttpServletRequest request, Long leftSecond, String body);

    public AjaxResult wechatPrePay(Long orderId, Long totalMoney, String openId, String outOrderNo, HttpServletRequest request, Long leftSecond, String body, String notifyUrl);

    public AjaxResult memberPay(Order order, Customer customer);

    public AjaxResult goodsMemberPay(Order order, Customer customer);

    public AjaxResult refundOrder(Order order, String accessToken, String cinemaLinkId, String outRefundNo);

    public AjaxResult refundMemberOrder(MemberCardOrder memberCardOrder, String accessToken, String cinemaLinkId, String outRefundNo);

    public boolean wechatRefund(OrderRefund orderRefund);

    public boolean getOrderInfo(Order order, String cinemaLinkId, String orderId, String accessToken, Customer customer);

    public boolean getFailedOrderInfo(Order order);

    public TableDataInfo selectGoodsOrderForApi(Order order);

    public TableDataInfo selectTicketOrderForApi(Order order);
}
